const http = require('http');
const request = require('superagent')

// let url = 'http://nodejs.cn/api/http.html'
let url = 'https://twitter.com/home?lang=zh-cn'
http.createServer((req, res) => {
  //利用url模块去解析客户端发送过来的URL
  request.get(url).then(ret => {
    res.end(ret.text)
    console.log(ret.text)
  })
}).listen(8080)
